package cn.kgc.controller;

import cn.kgc.entity.Student;
import cn.kgc.service.StudentService;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StudentController {
    @Reference
    private StudentService studentService;

    @RequestMapping("/getStudent")
    public PageInfo<Student> getStudent( @RequestParam(value = "pn",defaultValue = "1") Integer pn){
        return studentService.getAll(pn);
    }

    @RequestMapping("/add")
    public boolean add(Student student){

        System.out.println(student);return studentService.add(student);
    }
}
